package com.zyp.bean;

import java.util.Objects;

/**
 * 班级实体类，增加新的功能
 * 再增加班级管理功能：创建班级、修改班级信息、删除班级（前提：保证班级内没有关联学生）、查询班级， 此时需要为学生表增加字段：所属班级编号。
 * 其中班级信息有：班级名称、年级、班主任名称、班级口号 、班级人数
 */
public class TheClass {

    private String classID;//班级ID
    private String theClassName;// 班级名称
    private String grade;//年级
    private String nameOfClassTeacher;//班主任名称
    private String classMotto;//班级口号
    private String classSize;//班级人数

    public TheClass() {
    }

    public String getClassID() {
        return classID;
    }

    public void setClassID(String classID) {
        this.classID = classID;
    }

    public String getTheClassName() {
        return theClassName;
    }

    public void setTheClassName(String theClassName) {
        this.theClassName = theClassName;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getNameOfClassTeacher() {
        return nameOfClassTeacher;
    }

    public void setNameOfClassTeacher(String nameOfClassTeacher) {
        this.nameOfClassTeacher = nameOfClassTeacher;
    }

    public String getClassMotto() {
        return classMotto;
    }

    public void setClassMotto(String classMotto) {
        this.classMotto = classMotto;
    }

    public String getClassSize() {
        return classSize;
    }

    public void setClassSize(String classSize) {
        this.classSize = classSize;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TheClass theClass = (TheClass) o;
        return Objects.equals(classID, theClass.classID) &&
                Objects.equals(theClassName, theClass.theClassName) &&
                Objects.equals(grade, theClass.grade) &&
                Objects.equals(nameOfClassTeacher, theClass.nameOfClassTeacher) &&
                Objects.equals(classMotto, theClass.classMotto) &&
                Objects.equals(classSize, theClass.classSize);
    }

    @Override
    public int hashCode() {
        return Objects.hash(classID, theClassName, grade, nameOfClassTeacher, classMotto, classSize);
    }

    public TheClass(String classID, String theClassName, String grade, String nameOfClassTeacher, String classMotto, String classSize) {
        this.classID = classID;
        this.theClassName = theClassName;
        this.grade = grade;
        this.nameOfClassTeacher = nameOfClassTeacher;
        this.classMotto = classMotto;
        this.classSize = classSize;
    }

    @Override
    public String toString() {
        return "TheClass{" +
                "classID='" + classID + '\'' +
                ", theClassName='" + theClassName + '\'' +
                ", grade='" + grade + '\'' +
                ", nameOfClassTeacher='" + nameOfClassTeacher + '\'' +
                ", classMotto='" + classMotto + '\'' +
                ", classSize='" + classSize + '\'' +
                '}';
    }
}
